Use ROCm clang for Ghost unified-memory examples - #190
dannybaths wants to merge 2 commits into
Conversation
|
I am not seeing the issue arising on aac7 @dannybaths
|
|
what modules are you loading when testing this? |
|
you are right @gcapodagAMD, I indeed forgot to list the environment. Sorry for that. PrgEnv-amd-openmpi/openmpi-5.0.10-ofi-7.14.0 |
Signed-off-by: Daniele Bagni <danieleb@xilinx.com>
| fi | ||
| if [ -z "$FC" ]; then | ||
| export FC=`which ftn` | ||
| fi |
There was a problem hiding this comment.
I think changes should be made here because this covers the "CRAY" path, in the "AMD" case we have the right compilers set with the amdclang module
|
can you tell me what is the scope of the module |
Ghost Ver1-Ver5 previously exported the ROCm amdclang++ whenever it existed, which also overrode the Cray wrapper choice made by the CRAYPE_VERSION / /etc/cray-release branch above. On a Cray PE login that is a regression: measured on an MI300A node with ROCm 7.14, the stock scripts pass all five requested ghost CTests through the CC wrapper (CrayClang), while the unconditional override loses Ver3, Ver4 and Ver5. The failure the previous commit addressed happens in the other state: /etc/cray-release exists on a Cray system even when no PrgEnv module puts the wrappers on PATH, so the branch above exports an empty CXX and CMake falls back to /usr/bin/c++, which does not implement the OpenMP requires unified_shared_memory directive. In that state all five tests fail unpatched and pass with the ROCm compilers. Fill in the ROCm compilers only when CXX is empty or does not resolve, so a working wrapper choice or an explicit user setting is left alone.
4d58d1e to
61a35e7
Compare
|
Thanks for pushing back on this one — your CrayClang observation turned out to be the whole story, and the patch as I first wrote it was too broad. I re-proved it on AAC7 against current
So on a Cray PE login the stock scripts already make the right choice and my override was costing three ghost tests, which is exactly what you were seeing. The failure I originally reported is real, but it is confined to state B: I have force-pushed a narrowed version (rebased onto if [ -z "${CXX:-}" ] || ! command -v "${CXX}" >/dev/null 2>&1; then
if [ -x "${ROCM_PATH:-}/bin/amdclang++" ] && [ -x "${ROCM_PATH:-}/bin/amdclang" ]; then
export CXX="${ROCM_PATH}/bin/amdclang++"
export CC="${ROCM_PATH}/bin/amdclang"
fi
fiIn state A So far I have verified the narrowed form with a shell trace on the edited scripts in both states. The full two-state CTest re-proof is queued on AAC7 and on AAC6, pinned to the same ROCm 7.14.0 so the two machines compare directly, and I will post those numbers here when they land. Module environment for both statesState A, stock Cray PE: State B, OpenMPI PrgEnv: Compiler in both states: |
|
does state B show anything if you do |
| # the compiler wrappers on PATH. The branch above then exports an empty CXX and | ||
| # CMake falls back to /usr/bin/c++, which does not implement | ||
| # "#pragma omp requires unified_shared_memory". Use the ROCm compilers only in | ||
| # that case, so a working wrapper or an explicit user choice is left alone. |
There was a problem hiding this comment.
please remove these comments
| # the compiler wrappers on PATH. The branch above then exports an empty CXX and | ||
| # CMake falls back to /usr/bin/c++, which does not implement | ||
| # "#pragma omp requires unified_shared_memory". Use the ROCm compilers only in | ||
| # that case, so a working wrapper or an explicit user choice is left alone. |
There was a problem hiding this comment.
please remove these all over
|
@dannybaths careful I think you are still using the mpi wrappers with gcc, you also need to set |
|
load the full B path then do |
|
@dannybaths let me know if after the above the problem still shows, if so I'll merge. thanks |


What
The five
MPI_Ghost_Exchange_Ver[1-5]test scripts now select the ROCm C and C++compilers from
$ROCM_PATH/binwhenamdclangandamdclang++are present there.Each script exports
CC/CXXimmediately before its per-test CMake configure, sothe GhostExchange examples build with ROCm clang instead of whatever the MPI wrapper
defaults to (often GCC on Cray/Open MPI login environments).
These examples use
#pragma omp requires unified_shared_memory. GCC does notimplement that clause on the offload path these tests need.
Why
On MI300A systems where the MPI module defaults to GCC, CMake picks GCC and every
Ghost Ver1–5 build aborts on the
requires unified_shared_memoryline before launch.The scripts already use
ROCM_PATHfor the ROCm runtime; selecting the matchingROCm compiler keeps the tests self-contained without launcher-specific
-xflags orOpen MPI-only options on the scripts'
srunbranch.Validation
MI300A / gfx942, Open MPI,
HSA_XNACK=1,ROCM_PATHpointing at a ROCm installwith
bin/amdclangandbin/amdclang++. Focused run on upstreammain(20e93223):Environment details from the validation jobs:
AAC7 focused proof, jobs
10626unpatched and10627patched:In the unpatched AAC7 tree,
CC,CXX, andFCwere unset before CTest. Theper-test CMake runs selected
/usr/bin/ccand/usr/bin/c++, identified asGNU 11.5.0. With this PR applied, the per-test CMake runs selected
/shareddata/opt/rocm-7.14.0/bin/amdclangand/shareddata/opt/rocm-7.14.0/bin/amdclang++, identified as Clang 23.0.0.AAC6 no-regression, job
19736:Static checks on the branch:
Unpatched upstream: 0/5 pass. All five builds use GCC and fail at compile with
sorry, unimplemented: 'unified_shared_memory' clause on 'requires' directive not supported yet.With this change: 5/5 pass. Per-test CMake logs show
Check for working C/CXX compiler: …/rocm-…/bin/amdclang{,++}; CTest reports100% tests passed, 0 tests failed out of 5.AAC7 proof: current-main control on ROCm 7.14 / Open MPI 5.0.10 — unpatched 0/5,
patched 5/5.
AAC6 no-regression: MI300A, Lmod
rocm/7.14.0, Slurm job19736onppac-pl1-s24-16— 5/5 PASS withamdclang/amdclang++under$ROCM_PATH/bin.